/**
////////////////////////////////////////////////////////////////////////////////
//                                                                            // 
//  Copyright (c) 2013 Santiago Benito Rebollo. Eclipse Public License - v 1.0//
//  @author Santiago Benito Rebollo.                                          // 
//  santiago.benito.rebollo@gmail.com                                         //
//                                                                            //  
////////////////////////////////////////////////////////////////////////////////
//                                                                            //
// THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC// 
// LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM//
// CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.                      //
//                                                                            //
// A Contributor may choose to distribute the Program in object code form     //
// under its own license agreement, provided that:                            //
//                                                                            //
// a) it complies with the terms and conditions of this Agreement; and        //
// b) its license agreement:                                                  //
//                                                                            //
// i) effectively disclaims on behalf of all Contributors all warranties and  //
// conditions, express and implied, including warranties or conditions of     //  
// title and non-infringement, and implied warranties or conditions of        //
// merchantability and fitness for a particular purpose;                      //
// ii) effectively excludes on behalf of all Contributors all liability for   //
// damages, including direct, indirect, special, incidental and consequential //
// damages, such as lost profits;                                             //
// iii) states that any provisions which differ from this Agreement are       //
// offered by that Contributor alone and not by any other party; and          //
// iv) states that source code for the Program is available from such         //
// Contributor, and informs licensees how to obtain it in a reasonable        //
// manner on or through a medium customarily used for software exchange.      //
//                                                                            //
////////////////////////////////////////////////////////////////////////////////
 */

/**
CmIdentification
////////////////////////////////////////////////////////////////////////////////
// Version History:
// [Rev d.d dd Mmm yyyy hh:mm:ss    <logComment>]
$Log: Vertice.java,v $
////////////////////////////////////////////////////////////////////////////////
 */

package com.chago.fastrecado;

/**
 * This class symbolize the vertex object that are points in the graph
 * 
 * @author Santiago Benito Rebollo
 * @author santiago.benito.rebollo@gmail.com
 */

public class Vertice implements Comparable<Vertice>{

	/**
	The vertex name
	 */ 
	public final String name;

	/**
	The array of edges for this vertex
	 */
	public Arista[] adjacencies;
	
	/**
	The minDistance could exist between two vertex
	 */	
	public double minDistance = Double.POSITIVE_INFINITY;

	/**
	The previous vertex
	 */	
	public Vertice previous;

	/**
     * This is the main constructor. Arg is only the name
     * 
     * @param Vertice argTarget
     * @param double argDistance
     * @param double argTime
     * @throws none Exception
     * @pre argTarget!=null
     * @pre argDistance!=null
     * @pre argTime!=null
     * @post $none
   */     
	public Vertice(String argName) { name = argName; }

	/**
     * This method return implements toString method of Object class. Using only for tracing.
     * 
     * @param none
     * @throws none Exception
     * @pre $none
     * @post $none
   */     	
	public String toString() { return name; }

	/**
     * This method return the array with Adjacencies edges for this vertex
     * 
     * @param none
     * @throws none Exception
     * @pre $none
     * @post $none
   */     	
	public Arista[] getAdjancencies() {return adjacencies;}

	/**
     * This method implements the compareTo method of the comparable interface
     * 
     * @param none
     * @throws none Exception
     * @pre $none
     * @post $none
   */     
	public int compareTo(Vertice other)
	{
		return Double.compare(minDistance, other.minDistance);
	}

}
